package blackitheima1.IntegerTest;
//类型转换 int<->String
public class Integer3 {
    public static void main(String[] args) {
        //Integer->String
        Integer i=100;
        String i1=i+"";//Integer对象+字符串=字符串
        System.out.println(i1);

        //int->String
        //1.int常数+字符串
        //2.String类的valueof 方法
        int i3=100;
        String s1 = String.valueOf(i3);
        System.out.println(s1);

        //String->int  Ingeter类的parseInt 方法
        String s="100";
        int i2 = Integer.parseInt(s);
        System.out.println(i2);

        //String->int  String(Integer.valueof)->Integer->int
        String s2="200";
        Integer integer = Integer.valueOf(s2);
        int i4 = integer.intValue();
        System.out.println(i4);

    }
}
